// export const dfsPath = (ids, menuList) => {
//   const path = []
//   ids.forEach(element => {
//     path.push[element]
//   })
//   return []
// }

const inMenuList = (id, list) => {
  let _id = 0
  list.forEach(item => {
    if (item.menuId === id) {
      _id = item.parentId
    }
  })
  return _id
}
export const dfsPath = (id, menuList) => {
  const path = [id]
  let parentId = inMenuList(id, menuList)
  while (parentId) {
    path.push(parentId)
    parentId = inMenuList(parentId, menuList)
  }

  return path
}
